import { defineStore } from "pinia";
import { getRouter } from "@/api/overtrue";
import { ref } from "vue";

export const useMenusStore = defineStore("menus", () => {
  const menus = ref<any[]>([]);

  const getMenusSync = async () => {
    const res = await getRouter();
    menus.value = res.data.data;
  };
  const getMenus = () => {
    return menus.value;
  };
  return {
    menus,
    getMenusSync,
    getMenus,
  };
});
